﻿using GuanQL.Core.Domain.Medias;
using GuanQL.Core.Stores;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;

namespace GuanQL.DataMigration.Seeds
{
    public class PictureSeed : BaseSeed
    {
        public PictureSeed(GQLDbContext dbContext) : base(dbContext)
        {
        }

        public async override Task Seed()
        {
            var pictures = new List<Picture>();
            pictures.AddRange(GetRootPicture(Path.Combine(Directory.GetCurrentDirectory(), "Pictures\\Avatars"), TenantId, true, PictureType.Avatar));
          //  pictures.AddRange(GetRootPicture(Path.Combine(Directory.GetCurrentDirectory(), "Pictures\\Maintenances"), TenantId, false, PictureType.Entity));
            await _dbContext.Set<Picture>().AddRangeAsync(pictures);
            await _dbContext.SaveChangesAsync();
        }
    }
}
